<!DOCTYPE>
<html>
<head>
<title>yadmin | 登录</title>
#parse("/WEB-INF/views/common/AdminLTEHead.html")
</head>
<body class="hold-transition login-page">
	<div class="login-box">
	  <div class="login-logo">
	    <a href="${request.contextPath}"><b>Admin</b>LTE</a>
	  </div>
	  <!-- /.login-logo -->
	  <div class="login-box-body">
	    <p class="login-box-msg">Sign in to start your session</p>
	
		<div class="form-group has-feedback">
		  <input type="text" class="form-control" placeholder="请输入用户名" id="userName">
		  <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
		</div>
		<div class="form-group has-feedback">
		  <input type="password" class="form-control" placeholder="请输入密码" id="password">
		  <span class="glyphicon glyphicon-lock form-control-feedback"></span>
		</div>
		<div class="row">
		  <!-- /.col -->
		  <div class="col-xs-4">
		    <button type="button" class="btn btn-primary btn-block btn-flat" id="login">Sign In</button>
		  </div>
		  <!-- /.col -->
		</div>
	
	    <a href="#">I forgot my password</a><br>
	
	  </div>
	  <!-- /.login-box-body -->
	</div>
	<!-- /.login-box -->
	#parse("/WEB-INF/views/common/AdminLTEScript.html")
	<script type="text/javascript">
		$("#login").click(function(){
			var params = {userName:$("#userName").val(),password:$("#password").val()};
			$.ajax({
				url:'${request.contextPath}/login',
				data:params,
				dataType:'json',
				type:'POST',
				success:function(data){
					if(data.code==0){
						location.href="${request.contextPath}/main/";
					}else{
						alert(data.msg);
					}
				}
			});
		});
	</script>
</body>
</html>